import { Injectable } from '../decorators/inject';
import { NFill, NFont} from '../types/style.interface';
import { Hook } from './hook';
@Injectable('WholeCol')
export class WholeCol {
    protected width: number;
    protected fill: NFill.IFill = {};
    protected font: NFont.IFont = {};
    constructor(protected hook: Hook) {

    }
    public getFill() {
        // if(this.fill.updateTime === undefined) {
        //     return Object.assign({updateTime: 0}, this.fill);
        // }
        return this.fill;
    }
    public setFill() {

    }
    public getFont() {
        if(this.font.updateTime === undefined) {
            return Object.assign({updateTime: 0}, this.font);
        }
        return this.font;
    }
    public setFont() {
        
    }
    public getWidth() {
        return this.width;
    }
    public setWidth(width: number) {
        this.hook.beforeColWidthChange.excute(width);
        this.width = width;
        this.hook.afterColWidthChange.excute(width);
    }
}